/**
 * 待办详细页面，用于通过id查询名称的API
 *
 */
import { http } from "@/common/service.js";


/**
 * 合同-通过id查询
 */
const getContractName = async (header, params) => {
	const result = await http.get("/xy/xyCmContract/queryById",{header,params})
	console.log('getContractName',result)
	return result
};

/**
 * 项目机会-通过id查询
 */
const getProjectName = async (header, params) => {
  const result = await http.get("/xy/xyBcBussinessChance/queryById", {header,params});
  console.log('getProjectName',result)
  return result
};

/**
 * 用户名-通过userName查询
 */
const getUserName = async (header, params) => {
  const result = await http.get("/sys/user/list", {header,params});
  console.log('getUserName',result)
  return result
};

/**
 * 单位名-通过id查询
 */
const getCompanyName = async (header, params) => {
  const result = await http.get("/xy/xyCcCustomerCompany/queryById", {header,params});
  console.log('getCompanyName',result)
  return result
};

/**
* 用章类型名-通过数字辨别
*/
const getSealTypeName = (number) => {
	switch(number){
		case 0:
		return '公章'
		break;
		case 1:
		return '财务章'
		break;
		case 2:
		return '发票专用章'
		break;
		case 3:
		return '合同章'
		break;
		case 4:
		return '人事章'
		break;
		case 5:
		return '资质章'
		break;
		case 6:
		return '法人章'
		break;
		default:
		return '无'
	}
};

export default {
  getContractName,
  getProjectName,
  getUserName,
  getCompanyName,
  getSealTypeName
};
